package edu.whu.rose.clock.kps.algorithm.blinks.search3;

import edu.whu.rose.clock.kps.algorithm.blinks.index.PNEntry;

public class PNCursor3 extends Cursor3 {

	private PNEntry[] list;
	
	private final double base;
	
	public PNCursor3(int block, int portal, double base, PNEntry[] list) {
		super(block);
		this.base = base;
		this.list = list;
	}

	public boolean empty() {
		if (pos > list.length - 2) {
			return true;
		}
		else {
			return false;
		}
	}

	public int getFirst() {
		return ((PNEntry)list[pos]).getFirst();
	}

	public int getNode() {
		return ((PNEntry)list[pos]).getNode();
	}

	public double getDistance() {
		return base + ((PNEntry)list[pos]).getDistance();
	}

	public double peek() {
		return base + ((PNEntry)list[pos + 1]).getDistance();
	}

}
